<!DOCTYPE html>
<html>
<head>
<title>forget_passwd_update</title>
<@s.css 'login.css' />
<@s.script ['jquery-1.7.2.min.js','jquery.form.js','sha1.js','jquery.validator.js','jquery.sdialog.js'] />
<script type='text/javascript'>
<!--
$(document).ready(function(){
	$('#forget_pwd_form').validator({
	    msgHandler: function(msgs){
	        $.map(msgs, function(msg){
	        	showMessage(msg,"fail");
	        });
	    }
	});
	
	$('#loginPwd').focus();
	$('#forget_pwd_form').ajaxForm({
		beforeSerialize:function(){
			$('#loginPwd').val(CryptoJS.SHA1($('#loginPwd').val()));
			$('#reloginPwd').val(CryptoJS.SHA1($('#reloginPwd').val()));
		},
	    dataType:"json",
	    success: function(json) {
	    	$('#loginPwd').val("");
	    	$('#reloginPwd').val("");
    		$("#captcha").val("");
    		$('#captchaImage').attr('src','/security/captcha.htm?_='+Math.random());
	    	if(json.state){
	    		$.sdialog({	
	    			title:"系统提示",
	    			content:json.message,
	    			ok:function(){
	    				location.href="/auth/login.htm";
	    			}
	    		}).icon("success");
	    		
	    	}else{
	    		showMessage(json.message,"fail");
	    	}
	    }
	});
})
//-->
</script>
</head>
<body>
	<div class="m-form">
		<form name="forget_pwd_form" id="forget_pwd_form" action="<@s.url '/auth/forget_passwd_update.htm' />" method="post" >
			<input type="hidden" name="param" id="param" value="${param!''}" /> 
			<h1>账户登录</h1>
			<div class="formitm">
				<label class="lab">登录邮箱：</label>
				<div class="ipt">
					${user.loginMail}
				</div>
			</div>
			<div class="formitm">
				<label class="lab">新密码：</label>
				<div class="ipt">
					<input type="password" name="loginPwd" id="loginPwd"  data-rule="新密码:required;password" placeholder="新的登录密码" /> 
				</div>
			</div>
			<div class="formitm">
				<label class="lab">确认密码：</label>
				<div class="ipt">
					<input type="password" name="reloginPwd" id="reloginPwd"  data-rule="确认密码:required;password;match[loginPwd]" placeholder="请重新输入一次登录密码" /> 
				</div>
			</div>
			<div class="formitm">
				<label class="lab">验证码：</label>
				<div class="ipt">
					<input type="text" name="captcha" data-rule="验证码:required;"  placeholder="验证码"  style="width: 100px;" id="captcha"/>
					<a href="javascript:;" onclick="$('#captchaImage').attr('src','/security/captcha.htm?_='+Math.random());">看不清？换一张</a>
					<p class="tip">
						<@s.captcha />
					</p>
				</div>
			</div>
			<div class="formitm formitm-submit">
				<button class="u-btn" type="submit">立 即 登 录</button>
			</div>
		</form>
		<@s.message />
	</div>

</body>
</html>